//
//  IDCOLViewController.m
//  Collisions
//
//  Created by iD Student on 7/11/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "IDCOLViewController.h"

@interface IDCOLViewController ()
{
    IBOutlet UIImageView *imageViewA;
    IBOutlet UIImageView *ImageViewB;
    IBOutlet UILabel *statusLabel;
    UIImageView *theImage;
    int _theScore;
}
@end

@implementation IDCOLViewController


- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    _theScore = 10;
    NSLog(@"%d", _theScore);
}

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:[self view]];
    if(CGRectContainsPoint(imageViewA.frame, touchPoint))
    {
        statusLabel.text = @"You chose the red pill.";
    }
    else if(CGRectContainsPoint(ImageViewB.frame, touchPoint))
    {
        statusLabel.text = @"You chose the blue pill.";
    }
    else
    {
    statusLabel.text = @"";
    }
}

- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:[self view]];
    if(CGRectContainsPoint(imageViewA.frame, touchPoint))
    {
        statusLabel.text = @"no red pill?";
    }
    else if(CGRectContainsPoint(ImageViewB.frame, touchPoint))
    {
        statusLabel.text = @"no blue pill?";
    }
    else
    {
        statusLabel.text = @"";
    }
}

@synthesize theImage, theScore;




- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc {
    [imageViewA release];
    [ImageViewB release];
    [statusLabel release];
    [super dealloc];
}
@end
